<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="operate.*,operate.vo.*"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String id = request.getParameter("id");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>表单列表</title>
		<link rel="StyleSheet" href="<%=basePath %>form/css/table.css" type="text/css" />
		<link rel="StyleSheet" href="<%=basePath %>form/css/validate.css" type="text/css" />
		<script type="text/javascript" src="<%=basePath %>form/js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="<%=basePath %>form/js/easy_validator.pack.js"></script>
	</head>
	<body> 
	<a href="<%=basePath %>form/formAttr_add.jsp?id=<%=id %>">添加属性</a>
	<a href="<%=basePath %>servlet/FormServlet?id=<%=id %>">数据列表</a>
	<a href="<%=basePath %>form/data_add.jsp?id=<%=id %>">添加数据</a>
		<table border="1px" cellspacing="0px">
			<tr>
				<td width="11%">
					字段名称
				</td>
				<td width="11%">
					类型
				</td>
				<td width="6%">
					列表显示
				</td>
				<td width="6%">
					更新显示
				</td>
				<td width="11%">
					备选项
				</td>
				<td width="11%">
					默认值
				</td>
				<td width="12%">
					正则表达式名称
				</td>
				<td width="11%">
					正则表达式
				</td>
				<td width="11%">
					提示
				</td>
				<td width="15%">
				   操作
				</td>
			</tr>

			<%
				
				List<Attr> attrs = AttrOper.findAttrsById(id);
				for (Attr attr : attrs) {
			%>
			<tr>
				<td>
					<%=attr.getAname()%>
				</td>
				<td>
					<%=attr.getType()%>
				</td>
				<td>
					<%=attr.getList_view().equals("0")?"否":"是"%>
				</td>
				<td>
					<%=attr.getUpdate_view().equals("0")?"否":"是"%>
				</td>
				<td>
					<%=attr.getValue_list()%>
				</td>
				<td>
					<%=attr.getDefault_value()%>
				</td>
				<td>
					<%=attr.getReg_name()%>
				</td>
				<td>
					<%=attr.getReg()%>
				</td>
				<td>
					<%=attr.getTip()%>
				</td>
				<td>
					<a href="<%=basePath %>form/formAttr_edit.jsp?id=<%=attr.getId() %>">修改</a>|删除
				</td>
			</tr>
			<%
			}
			%>

		</table>
	</body>
</html>

